package com.thoughtful.amqp.service;

import com.thoughtful.amqp.entity.Book;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Service;

/**
 * @ClassName: BookService
 * @author: zyx
 * @E-mail: 1377631190@qq.com
 * @DATE: 2021/2/7 17:36
 */
@Service
public class BookService {

    @RabbitListener(queues = {"thoughtful"})
    public void thoughtful(Book book) {
        System.out.println(book);
    }

    @RabbitListener(queues = "thoughtful.joker")
    public void thoughtfulJoker(Message message) {
        System.out.println(message.getMessageProperties());
        System.out.println(message);
    }

}
